package MaintMenu.PoAnalysis;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 * Created with IntelliJ IDEA.
 * User: Jason
 * Date: 7/10/13
 * Time: 4:49 PM
 * To change this template use File | Settings | File Templates.
 */
public class DateRange {
    public DateRange(){


    }
    public String today(){


        DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
        Date today = new Date();
        Calendar cal = new GregorianCalendar();
        cal.setTime(today);
        String todaya = formatter.format(today);
        return todaya;

    }
    public String threeDayBack(){


        DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
        Calendar cal = new GregorianCalendar();
        cal.add(Calendar.DAY_OF_MONTH, -4); //  -4 for 4 day PO Analysis, but not including today.
        Date today8 = cal.getTime();
        String today8a = formatter.format(today8);

        return today8a;

    }
    public String yesterday(){

        DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
        Calendar cal = new GregorianCalendar();
        cal.add(Calendar.DAY_OF_MONTH, -1);
        Date yesterday1 = cal.getTime();
        String yesterday = formatter.format(yesterday1);
        return yesterday;
    }

//        cal.add(Calendar.DAY_OF_MONTH, -1);
//        Date yesterday1 = cal.getTime();
//        String yesterday = formatter.format(yesterday1);
//
//        cal.add(Calendar.DAY_OF_MONTH, -4); // changed from -8 to -4 for 4 day PO Analysis, but not including today.
//        Date today8 = cal.getTime();
//        String today8a = formatter.format(today8);
//
//
//        cal.add(Calendar.DAY_OF_MONTH, -30);
//        Date today30 = cal.getTime();
//        String today30a = formatter.format(today30);
//
//        cal.add(Calendar.DAY_OF_MONTH, -30);
//        Date today60 = cal.getTime();
//        String today60a = formatter.format(today60);
//
//        cal.add(Calendar.DAY_OF_MONTH, -30);
//        Date today90 = cal.getTime();
//        String today90a = formatter.format(today90);
//
//    }
}
